Skip to content

Conversation

@aabrown100-git
Copy link
Collaborator

@aabrown100-git aabrown100-git commented Sep 28, 2025

Current situation

Resolves #444

Release Notes

  • Replace <Robin_vtp_file_path> xml element with <Spatial_values_file_path> for providing path to spatially variable Robin boundary condition .vtp file.
  • Also, add warning to uniform values RobinBoundaryCondition constructor if both stiffness and damping are 0.
  • Fix point matching bug when mesh_scale_factor is not 1.

Testing

Modifies struct/spatially_variable_robin and ustruct/spatially_variable_robin tests with new xml format.

Code of Conduct & Contributing Guidelines

…warning if RobinBoundaryCondition is constructed with 0 stiffness and 0 damping
@aabrown100-git aabrown100-git self-assigned this Sep 28, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors XML parameter naming for spatially variable Robin boundary conditions and adds validation warnings. It replaces the specific Robin_vtp_file_path element with the more general Spatial_values_file_path element to maintain consistency with other boundary condition types.

  • Replace <Robin_vtp_file_path> with <Spatial_values_file_path> in XML configuration
  • Add warning when Robin boundary condition has both stiffness and damping set to zero
  • Update test cases to use the new XML format

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/cases/ustruct/spatially_variable_robin/solver.xml Updates XML element name for Robin BC file path
tests/cases/struct/spatially_variable_robin/solver.xml Updates XML element name for Robin BC file path
Code/Source/solver/read_files.cpp Changes parameter reference from robin_vtp_file_path to spatial_values_file_path
Code/Source/solver/RobinBoundaryCondition.h Moves constructor from inline to declaration only
Code/Source/solver/RobinBoundaryCondition.cpp Implements constructor with zero-value warning logic
Code/Source/solver/Parameters.h Removes robin_vtp_file_path parameter declaration
Code/Source/solver/Parameters.cpp Removes robin_vtp_file_path parameter initialization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

*/

#include "RobinBoundaryCondition.h"
#include <iostream>
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using std::cout directly is not recommended for library code. Consider using a proper logging framework or at minimum std::cerr for warnings to avoid mixing output streams.

Copilot uses AI. Check for mistakes.
{
// Warning if both stiffness and damping are zero
if (uniform_stiffness == 0.0 && uniform_damping == 0.0) {
std::cout << "WARNING: Robin boundary condition has both stiffness and damping values set to zero. "
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning messages should be written to std::cerr instead of std::cout to properly separate error/warning output from regular program output.

Suggested change
std::cout << "WARNING: Robin boundary condition has both stiffness and damping values set to zero. "
std::cerr << "WARNING: Robin boundary condition has both stiffness and damping values set to zero. "

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no difference between the cout and cerr output message, just that cerr does not buffer data.

Warning messages should be written using simulation->logger so they will appear in the histor.dat file.

Should we throw when the both the stiffness and damping values are zero ?

@aabrown100-git aabrown100-git changed the title Replace Robin_vtp_file_path with Spatial_values_file_path. Also, add … Spatially variable Robin BC bug fixes Sep 28, 2025
@aabrown100-git aabrown100-git deleted the robin_spatial_values_file_path branch September 28, 2025 22:01
@codecov
Copy link

codecov bot commented Sep 28, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.46%. Comparing base (277dd06) to head (4c17dee).

Files with missing lines Patch % Lines
Code/Source/solver/RobinBoundaryCondition.cpp 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #445      +/-   ##
==========================================
+ Coverage   67.42%   67.46%   +0.03%     
==========================================
  Files         169      170       +1     
  Lines       34142    34146       +4     
  Branches     5727     5729       +2     
==========================================
+ Hits        23021    23035      +14     
+ Misses      10983    10972      -11     
- Partials      138      139       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spatially variable Robin BC bug fixes

2 participants